package com.atguigu.admin.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @author anan
 * @create 2021-08-31 10:42
 */
/*@EnableConfigurationProperties*/
@Configuration
public class MyDataSourceConfig {

    @ConfigurationProperties("spring.datasource")
    @Bean
    public DataSource dataSource(){
        DruidDataSource druidDataSource = new DruidDataSource();
/*        druidDataSource.setUrl();
        druidDataSource.setUsername();
        druidDataSource.setPassword();*/
        return druidDataSource;
    }
}
